package com.taobao.txc.common.a;

import com.taobao.middleware.logger.Logger;
import com.taobao.middleware.logger.LoggerFactory;
import com.taobao.txc.common.config.o;
import java.util.concurrent.atomic.AtomicLong;

public class a
{
  private static final String a = Character.toString('\037');
  private Logger b;
  private b c = null;
  private ThreadLocal<Long> d = new ThreadLocal();
  private AtomicLong e = new AtomicLong(0L);
  private static a f;
  
  public static a a()
  {
    if (f == null) {
      synchronized (a.class)
      {
        if (f == null) {
          f = new a();
        }
      }
    }
    return f;
  }
  
  private a()
  {
    e();
  }
  
  private void e()
  {
    this.b = LoggerFactory.getLogger("txc-analyze");
    this.b.activateAppenderWithSizeRolling("txc", "txc.analyze.log", "utf-8", "100mb", 100);
    this.c = new b();
  }
  
  public boolean b()
  {
    return o.a().c();
  }
  
  private String a(Object[] paramArrayOfObject)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    int i = 1;
    for (Object localObject : paramArrayOfObject)
    {
      if (i != 0) {
        i = 0;
      } else {
        localStringBuilder.append(a);
      }
      localStringBuilder.append(localObject);
    }
    return localStringBuilder.toString();
  }
  
  public void a(String paramString, Object... paramVarArgs)
  {
    if (!b()) {
      return;
    }
    this.b.info(paramString, a(paramVarArgs));
  }
  
  public void a(String paramString)
  {
    this.c.a(paramString);
  }
  
  public long c()
  {
    Long localLong = (Long)this.d.get();
    if (localLong == null)
    {
      this.d.set(new Long(System.currentTimeMillis()));
      return 0L;
    }
    long l1 = System.currentTimeMillis();
    long l2 = l1 - localLong.longValue();
    this.d.set(new Long(l1));
    return l2;
  }
  
  public long d()
  {
    return this.e.incrementAndGet();
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.a.a
 * JD-Core Version:    0.7.0.1
 */